<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>tango.text.Properties</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="css/ie56hack.css"><![endif]-->
<script language="JavaScript" src="js/util.js" type="text/javascript"></script>
<script language="JavaScript" src="js/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="js/explorer.js" type="text/javascript"></script>
<script>
function anchorFromTitle(title, path, ext) {
  var url = path + title + "." + ext;
  document.write("<a href='" + url + "'>" + title + "</a>");
  }
</script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("tango.text.Properties");</script>
        <table class="content">
                <tr><td id="docbody"><h1><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/text/Properties.d?rev=3461">tango.text.Properties</a></h1>
                
<b>License:</b><br>
BSD style: see <a href="http://www.dsource.org/projects/tango/wiki/LibraryLicense">license.txt</a><br><br>
<b>Version:</b><br>
Initial release: May 2004<br><br>
<b>author:</b><br>Kris<br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>class <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/text/Properties.d?rev=3461#L31">Properties</a></span>
<script>explorer.outline.addDecl('Properties');</script>(T);</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Provides load facilities for a properties file. That is, a file
        or other medium containing lines of text with a name=value layout.</font><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/text/Properties.d?rev=3461#L40">load</a></span>
<script>explorer.outline.addDecl('load');</script>(FilePath <span class="funcparam">path</span>, void delegate (T[] name, T[] value) <span class="funcparam">dg</span>); [static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Load properties from the named file, and pass each of them
                to the provided delegate.</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/text/Properties.d?rev=3461#L68">load</a></span>
<script>explorer.outline.addDecl('load');</script>(InputStream <span class="funcparam">stream</span>, void delegate (T[] name, T[] value) <span class="funcparam">dg</span>); [static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Load properties from the provided buffer, and pass them to
                the specified delegate.</font><br><br>
<font color="black">We use an iterator to sweep text lines, and extract lValue
                and rValue pairs from each one, The expected file format is
                as follows:<br><br>                <pre class="d_code">
<td><div class="compilerinfo">
<p class="error L">/home/aziz/tango/tango/text/Properties.d(6,17)L: expected 'line' after '#'.</p>
</div>
</td></tr><tr>
                <span class="i">x</span> = <span class="i">y</span>
                <span class="i">abc</span> = <span class="n">123</span>
                <span class="i">x</span>.<span class="i">y</span>.<span class="i">z</span> = <span class="k">this</span> <span class="k">is</span> <span class="i">a</span> <span class="i">single</span> <span class="i">property</span>

                <span class="hl">#</span> <span class="k">this</span> <span class="k">is</span> <span class="i">a</span> <span class="i">comment</span> <span class="i">line</span>
                
</pre><br><br></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/text/Properties.d?rev=3461#L93">save</a></span>
<script>explorer.outline.addDecl('save');</script>(FilePath <span class="funcparam">path</span>, T[][T[]] <span class="funcparam">properties</span>); [static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Write properties to the provided filepath</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/text/Properties.d?rev=3461#L107">save</a></span>
<script>explorer.outline.addDecl('save');</script>(OutputStream <span class="funcparam">stream</span>, T[][T[]] <span class="funcparam">properties</span>); [static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Write properties to the provided stream</font><br><br></dd></dl></dd></dl></td></tr>
                <tr><td id="docfooter">
                        Copyright (c) 2004 Kris Bell. All rights reserved :: page rendered by CandyDoc. Generated by <a href="http://code.google.com/p/dil">dil</a> on Sun Jun  8 17:12:57 2008.
                </td></tr>
        </table>
</div>
<script></script>
</body></html>